package com.sww.pj.sys.controller;
import com.sww.pj.sys.pojo.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sww.pj.common.pojo.JsonResult;
import com.sww.pj.common.pojo.PageObject;
import com.sww.pj.sys.pojo.SwwLog;
import com.sww.pj.sys.service.SwwLogService;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/log/")
public class SwwLogController {
	
	@Autowired
	private SwwLogService sysLogService;

	@RequestMapping("doLogParams")
	public JsonResult doLogParams(Integer id) {
		Log params = sysLogService.doLogParams(id);
		JsonResult obj=new JsonResult(params);
		return obj;
	}

	@RequestMapping("doDeleteObjects")
	@ResponseBody
	public JsonResult doDeleteObjects(Integer... ids){
		sysLogService.deleteObjects(ids);
		return new JsonResult("删除成功");
	}
	
	@RequestMapping("doFindPageObjects")
	@ResponseBody
	public JsonResult doFindPageObjects(String username,Long pageCurrent) {
//		try {
			PageObject<SwwLog> pageObject=
					sysLogService.findPageObjects(username, pageCurrent);
			return new JsonResult(pageObject);
//		}catch(Throwable e) {
//			return new JsonResult(e);
//		}
	}
	


}





